/**
 * 广告数据相关api
 */
angular.module('imsApp').factory('AdDataManager', ['$http', 'api','paramsManager', function ($http,api, paramsManager) {
    var AdDataManager = {
        /**
         * 获取广告日统计的实时数据
         */
        adDataRt: function () {
            return $http.get(api+'/ims/adDataRt').then(function (result) {
                return result;
            });
        },
        /**
         * 获取广告日统计的每日数据
         */
        adDataDay: function (query) {
            return $http.get(api+'/ims/adDataDay' + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取按广告主分组统计的广告数据
         */
        adDataAdvertiser: function (params, query) {
            return $http.get(api+'/ims/adDataAdvertiser/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取按应用分组统计的广告数据
         */
        adDataApp: function (params, query) {
            return $http.get(api+'/ims/adDataApp/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取按广告计划分组统计的广告数据
         */
        adDataCampaign: function (params, query) {
            return $http.get(api+'/ims/adDataCampaign/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取按渠道分组统计的广告数据
         */
        adDataChannel: function (params, query) {
            return $http.get(api+'/ims/adDataChannel/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取按广告推广组分组统计的广告数据
         */
        adDataGroup: function (params, query) {
            return $http.get(api+'/ims/adDataGroup/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取用户的实时数据
         */
        userDataRt: function () {
            return $http.get(api+'/ims/userDataRt/total').then(function (result) {
                return result;
            });
        },
        /**
         * 获取整体趋势数据
         */
        wholeDataView: function () {
            return $http.get(api+'/ims/userData/total').then(function (result) {
                return result;
            });
        },
        /**
         * 获取整体数据详情
         */
        wholeDataViewDetail: function (query) {
            return $http.get(api+'/ims/userData/detail'+ paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

    }

    return AdDataManager;
}]);
